/*
 * @Author: zi.yang
 * @Date: 2021-09-29 00:13:21
 * @LastEditors: zi.yang
 * @LastEditTime: 2021-10-02 11:01:02
 * @Description: In User Settings Edit
 * @FilePath: \ziYangPM\vue.config.js
 */
const webpack = require('webpack')
module.exports = {
  publicPath: '/',

  configureWebpack: {
    plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)],
    resolve: {
      alias: {
        vue$: 'vue/dist/vue.common.js'
      }
    }
  },

  pluginOptions: {
    i18n: {
      locale: 'en',
      fallbackLocale: 'en',
      localeDir: 'locales',
      enableInSFC: false
    }
  },

  devServer: {
    port: 8080,
    hot: true,
    open: 'chrome',
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: process.env.VUE_APP_API_HOST,
        pathRewrite: {
          [`^${process.env.VUE_APP_BASE_API}`]: '/api/v1/'
        },
        changeOrigin: true
      }
    },
    overlay: {
      warnings: true,
      errors: true
    }
  }
}
